package utilities;

import java.util.ArrayList;

public final class ColorConverter {
	
	public static ArrayList<Float> convertColors(ArrayList<Integer> inputColors) {
		
		ArrayList<Float> finalColors = new ArrayList<Float>();
		
		for (Integer color: inputColors) {
			finalColors.add(convert(color));
		}		
		
		return finalColors;		
	}
	
	public static Float convertSingleColor(Integer inputColor) {
		return convert(inputColor);
	}
	
	private static Float convert(Integer color) {
		float finColor = 0.0f;
		
		if (color > 255) {
			color = 255;
		}
		else if (color < 0) {
			color = 0;
		}
			
		finColor = (float) color/255.0f;
		
		return finColor;
	}
	
	
	

}
